-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow manual specification of python executable during build #1602
Conversation
I note that you can no longer change the python path twice by rerunning configure -- run it once only. But hopefully there isn't anyone relying on that. |
Thanks a lot for this contribution. |
@buhtz I will reviewing and testing this in the next days
Do you mean a 2nd Edit: OK, it is because |
common/configure
Outdated
esac | ||
sed -e "s/^python3\? /python${PYVERSION} /g" \ | ||
-e "s/^ssh-agent python3\? /ssh-agent python${PYVERSION} /g" \ | ||
sed -e "s#^python3 #${PYTHON} #g" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is #
instead of /
used as substitution delimiter?
It does work surprisingly...
Edit: man sed
says:
cregexpc Match lines matching the regular expression regexp. The c may be any character.
so I would have expected a leading backslash...n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, any character can be used as long (as it doesn't appear in regexp
, of course) -- I picked #
since that was already used in qt/configure for the same purpose.
@@ -324,7 +328,7 @@ done | |||
|
|||
# check python version | |||
PYTHON_VERSION_REQUIRED="3.8" | |||
PYTHON_VERSION_CURRENT=$(python${PYVERSION} --version | tr --delete 'Python ') | |||
PYTHON_VERSION_CURRENT=$(${PYTHON} --version | tr --delete 'Python ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful code now, well done 😃
Yes, that's right. The proper way to do this (c.f. autotools) would be to have a template file ("backintime.in") which is used to create the real "backintime" every time configure is run. This would be a more invasive change, and may not be worth it to implement right now if you are rewriting the build system anyway. |
I fully agree and given the fact that the python version is not changed on the build computer anymore (normally) it is IMHO a valid approach. It would be great if you place just a short comment in the code as hint about this restriction. THX :-) |
Here's a compromise to avoid rewriting too much -- a version which prints a warning if the sed python path replacement fails. Feel free to change the text to something you like better. I removed the |
Dear @Fantu , |
Perfect as is now!
Just checked it, you are right, Lines 255 to 305 in 2df7731
So this is useless legacy code ( |
Probably not, but I'm not sure. |
@tguruswamy I have merged your PR now into our |
common/configure and qt/configure now support
--python=PYTHON_PATH
option to manually specify the python executable. A full, absolute path is preferred but any valid path should work.Previous --python and --python3 options also should still work, representing /usr/bin/python and /usr/bin/python3 respectively.
Tests pass on openSUSE Leap 15.5 and Tumbleweed.
This is the quick fix for #1574 .